home *** CD-ROM | disk | FTP | other *** search
- Path: news.cern.ch!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Trace C memory allocation
- Date: 15 Apr 96 00:32:43 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.829528363@news.cern.ch>
- References: <4ks3n2$2mt@news.hklink.net>
- NNTP-Posting-Host: sp067.cern.ch
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
-
- In <4ks3n2$2mt@news.hklink.net> alex@station.net (Alex Chu) writes:
-
- > I using the Turbo C 2.0 for DOS at this moment. I wonder that how can
- >I trace the memory allocation in C. The 'Add Watch' option only can
- >trace the memory variable. If I use the Free() function, how could I
- >know the pointer is really freed or not ?
-
- Dunno about Free() (there ain't no such function in C), but if you pass
- a pointer returned by [mc]alloc or realloc to free(), it _will_ be freed.
- Of course, you can't tell that it's been freed by looking at its value,
- but if you need to be able to do this, simply set it to NULL right after
- calling free().
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-